<!doctype html>
<html class="no-js">
<head>
  <include file="./Apps/WebApp/View/default/common_meta.html" />
  <title>购物车 - {$CONF['mallTitle']}</title>
  <meta name="keywords" content="{$CONF['mallKeywords']},购物车" />
  <meta name="description" content="{$CONF['mallDesc']},购物车" />
  <link rel="stylesheet" href="__ROOT__/Apps/WebApp/View/default/AmazeUI/assets/css/amazeui.min.css">
  <link rel="stylesheet" href="__ROOT__/Apps/WebApp/View/default/css/common.css?v={$WST_V}">
  <link rel="stylesheet" href="__ROOT__/Apps/WebApp/View/default/css/cart.css?v={$WST_V}">
</head>
<body>
  <header class="wst-nav">
    <div class="am-g">
      <div class="am-u-sm-2">&nbsp;</div>
      <div class="am-u-sm-8 wst-nav-center">
        <span class="wst-header-center">购物车</span>
      </div>
      <div class="am-u-sm-2">
      <?php if(!empty($cartInfo['cartgoods'])){ ?>
        <span id="editCart" class="wst-header-right">编辑</span>
        <span id="editDone" class="wst-header-right" style="display:none;">完成</span>
      <?php }else{ ?>
        &nbsp;
      <?php } ?>
    </div>
    </div>
  </header> 
    
  <empty name="cartInfo['cartgoods']">
    <div class="am-g cart-empty">
      <div class="am-u-sm-12 am-u-sm-centered" style="text-align:center;">
        <i class="am-icon-shopping-cart user-cart"></i>
        <span class="cart-empty-tips">购物车空空如也</span>
      </div>
    </div>
  </empty>
  <div class="cart-container">

    <volist name="cartInfo['cartgoods']" key="k" id="shopgoods">
      <div class="cart-list <?php if($k==count($cartInfo['cartgoods'])){ echo 'last-list';}?>">
        <div class="shopinfo">
          <i class="shop-check-icon list{$k} <?php if($shopgoods["isCheckTotal"]==count($shopgoods['shopgoods'])){ echo 'am-icon-check-circle active';}else{ echo 'am-icon-circle-thin';}?>" childrenId="clist{$k}" shop="shop{$k}" deliveryFreeMoney="{$shopgoods["shopgoods"][0]["deliveryFreeMoney"]}"></i>
          <span>{$shopgoods["shopName"]}</span>
        </div>
        <span class="shopfee" id="clist{$k}"></span>

        <!-- 优惠套餐 -->
        <volist name="shopgoods['packages']" key="k3" id="package">
          <div class="am-g am-g-collapse package-row <?php if($package['goodsStock']==0){ echo 'no-stock';}?>">
            <div class="am-g am-g-collapse package-detail">
                <div class="am-u-sm-1">
                  <i class="check-icon package-check clist{$k} <?php if($package["isCheck"]==1){ echo 'am-icon-check-circle active';}else{ echo 'am-icon-circle-thin';}?>" id="package_{$package["packageId"]}" parentId="list{$k}" packageId="{$package["packageId"]}" goodsNum="{$package["goodsCnt"]}" shop="shop{$k}" shopPrice="{$package["shopPrice"]}" isCheck="{$package["isCheck"]}" cartId="<?php echo implode('#', $package["cartIds"]);?>" batchNo="{$package["batchNo"]}"></i>
                </div>
                <div class="am-u-sm-11 package-name">{$package['packageName']}</div>
            </div>
            <volist name="package['goods']" key="k3" id="goods">
              <div class="am-g am-g-collapse package-shopdetails">
                  <div class="am-u-sm-1"></div>
                  <div class="am-u-sm-11">
                      <div class="am-g am-g-collapse">
                        <div class="am-u-sm-4">
                          <a href="javascript:void(0);" onclick="javascript:goToGoodsDetails({$goods['goodsId']});"><img src="__ROOT__/{$CONF['goodsImg']}" data-echo="__ROOT__/{$goods['goodsThums']}" style="width:80%;" class="cart-goodsimg"></a>
                        </div>
                        <div class="am-u-sm-8">
                          <div class="am-g am-g-collapse cartinfo-top">
                            <div class="am-u-sm-9 cart-goodsname">
                              <a href="javascript:void(0);" onclick="javascript:goToGoodsDetails({$goods['goodsId']});">{$goods["goodsName"]}</a>
                            </div>
                            <div class="am-u-sm-3 align-right"> ¥<?php echo sprintf("%.2f", $goods["shopPrice"]);?></div>
                          </div>
                          <div style="clear:both;"></div>
                          <div class="am-g am-g-collapse">
                            <?php if($goods["goodsSpec"]!=''){ ?>
                              <div class="am-u-sm-12 goods-spec">规格: {$goods["goodsSpec"]}</div>
                            <?php } ?>
                            <div class="am-u-sm-9">
                            <?php if($goods["isPriceAttr"]==1){ ?>
                              {$goods["attrName"]}: {$goods["attrVal"]}
                            <?php } ?>
                            </div>
                            <div class="am-u-sm-3 align-right oldgoodsnum">x<span class="goods-cnt-span">{$goods["cnt"]}</span>
                            </div>
                          </div>
                        </div>
                      </div>
                  </div>
              </div>
            </volist>
            <div class="am-g am-g-collapse package-shopdetails cartinfo-editarea">
              <div class="am-u-sm-2">&nbsp;</div>
              <div class="am-u-sm-8">
                <div class="am-u-sm-3 changenum" onclick="javascript:changePackageNum({$package['packageId']}, {$package['batchNo']}, 1);"><i class="am-icon-minus"></i></div>
                <div class="am-u-sm-4">
                  <input type="text" id="packageCount_{$package['packageId']}" class="goods-cnt-input" value="{$package['goodsCnt']}" autocomplete="off" onkeypress="return WST.isNumberKey(event);" onkeyup="javascript:changePackageNum({$package['packageId']}, {$package['batchNo']},);">
                </div>
                <div class="am-u-sm-3 changenum" onclick="javascript:changePackageNum({$package['packageId']}, {$package['batchNo']}, 2);"><i class="am-icon-plus"></i></div>
                <div class="am-u-sm-2">&nbsp;</div>
              </div>
              <div class="am-u-sm-2">&nbsp;</div>
            </div>
          </div>

        </volist>

        <volist name="shopgoods['shopgoods']" key="k2" id="goods">
          <div class="am-g am-g-collapse shopdetails <?php if($goods['goodsStock']==0){ echo 'no-stock';}?>">
              <div class="am-u-sm-1 shopdetails-checkicon">
                <i class="check-icon goods-check-icon clist{$k} <?php if($goods["isCheck"]==1){ echo 'am-icon-check-circle active';}else{ echo 'am-icon-circle-thin';}?>" id="goods_{$goods["goodsId"]}" parentId="list{$k}" goodsAttrId="{$goods["goodsAttrId"]}" goodsId="{$goods["goodsId"]}" goodsNum="{$goods["cnt"]}" shop="shop{$k}" shopPrice="{$goods["shopPrice"]}" isCheck="{$goods["isCheck"]}" cartId="{$goods["cartId"]}"></i>
              </div>
              <div class="am-u-sm-3">
                <a href="javascript:void(0);" onclick="javascript:goToGoodsDetails({$goods['goodsId']});"><img src="__ROOT__/{$CONF['goodsImg']}" data-echo="__ROOT__/{$goods['goodsThums']}" style="width:80%;" class="cart-goodsimg"></a>
              </div>
              <div class="am-u-sm-8">
                <div class="am-g am-g-collapse cartinfo-top">
                  <div class="am-u-sm-9 cart-goodsname">
                    <a href="javascript:void(0);" onclick="javascript:goToGoodsDetails({$goods['goodsId']});">{$goods["goodsName"]}</a>
                  </div>
                  <div class="am-u-sm-3 align-right"> ¥<?php echo sprintf("%.2f", $goods["shopPrice"]);?></div>
                </div>
                <div style="clear:both;"></div>
                <div class="am-g am-g-collapse cartinfo-editarea">
                  <div class="am-u-sm-3 changenum" onclick="javascript:changeNum({$goods['goodsId']}, {$goods['goodsAttrId']}, {$goods['shopPrice']}, 1);"><i class="am-icon-minus"></i></div>
                  <div class="am-u-sm-4"><input type="text" id="goodsCount_{$goods['goodsId']}_{$goods['goodsAttrId']}" class="goods-cnt-input" value="{$goods['cnt']}" goodsAttrId="{$goods['goodsAttrId']}" autocomplete="off" onkeypress="return WST.isNumberKey(event);" onkeyup="javascript:changeNum({$goods['goodsId']},{$goods['goodsAttrId']},{$goods['shopPrice']});"></div>
                  <div class="am-u-sm-3 changenum" onclick="javascript:changeNum({$goods['goodsId']}, {$goods['goodsAttrId']}, {$goods['shopPrice']}, 2);"><i class="am-icon-plus"></i></div>
                  <div class="am-u-sm-2">&nbsp;</div>
                </div>
                <div class="am-g am-g-collapse">
                  <?php if($goods["goodsSpec"]!=''){ ?>
                    <div class="am-u-sm-12 goods-spec">规格: {$goods["goodsSpec"]}</div>
                  <?php } ?>
                  <div class="am-u-sm-9">
                  <?php if($goods["isPriceAttr"]==1){ ?>
                    {$goods["attrName"]}: {$goods["attrVal"]}
                  <?php } ?>
                  </div>
                  <div class="am-u-sm-3 align-right oldgoodsnum">x<span class="goods-cnt-span">{$goods["cnt"]}</span>
                  </div>
                </div>
              </div>
          </div>
        </volist>

      </div>
    </volist>

  </div>
  
  <?php if(!empty($cartInfo['cartgoods'])){ ?>
    <div class="am-g am-g-collapse buy-area">
      <div class="am-u-sm-9 total-money-area tosubmit">
        <i class="am-icon-check-circle active total-icon"></i>
        <span class="total-money">合计：<span id="total-money"><?php echo sprintf("%.1f", $cartInfo['totalMoney']);?></span>元</span>
      </div>
      <div class="am-u-sm-3 buyit" id="buyit-area">结算</div>
      <div class="am-u-sm-3 delit-area" id="delit-area" style="display:none;"><span class="delit" id="delit">删除</span></div>
    </div>
  <?php } ?>

  <div class="am-modal am-modal-alert" tabindex="-1" id="wst-alert">
    <div class="am-modal-dialog">
      <div class="am-modal-hd" id="alertMsg"></div>
      <div class="am-modal-footer">
        <span class="am-modal-btn">确定</span>
      </div>
    </div>
  </div>

  <div class="am-modal am-modal-confirm" tabindex="-1" id="wst-confirm">
    <div class="am-modal-dialog">
      <div class="am-modal-hd" id="confirmMsg"></div>
      <div class="am-modal-footer">
        <span class="am-modal-btn" data-am-modal-cancel>取消</span>
        <span class="am-modal-btn" data-am-modal-confirm>确定</span>
      </div>
    </div>
  </div>

  <include file="./Apps/WebApp/View/default/common_footer.html" />  
  <include file="./Apps/WebApp/View/default/common_js.html" /> 
  <script src="__ROOT__/Apps/WebApp/View/default/js/cart.js?v={$WST_V}"></script>
</body>
</html>